package com.loongtech.bi.entity.core;

import java.io.Serializable;
/**
 * 主键类，包括组合主键channelId和账号标识
 * @author xckuang
 * @date 2015-04-02
 */ 
public class KeyChannelAndUserId implements Serializable
{
	//平台标识
	private String				channelId;
	//账号标识
	private String				userId;
	private static final long	serialVersionUID	= 1L;

	public KeyChannelAndUserId()
	{
	}

	public KeyChannelAndUserId(String channelId, String userId)
	{
		this.channelId = channelId;
		this.userId = userId;
	}

	public String getChannelId()
	{
		return channelId;
	}

	public void setChannelId(String channelId)
	{
		this.channelId = channelId;
	}

	public String getUserId()
	{
		return userId;
	}

	public void setUserId(String userId)
	{
		this.userId = userId;
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + ((userId == null) ? 0 : userId.hashCode());
		result = prime * result + ((channelId == null) ? 0 : channelId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
		{
			return true;
		}
		if (obj == null || getClass() != obj.getClass())
		{
			return false;
		}
		final KeyChannelAndUserId o = (KeyChannelAndUserId) obj;
		if (userId == null && o.userId != null || null != userId && !userId.equals(o.userId))
		{
			return false;
		}
		if (channelId == null && o.channelId != null || null != channelId && !channelId.equals(o.channelId))
		{
			return false;
		}
		return true;
	}

	@Override
	public String toString()
	{
		return "KeyChannelAndUserId [channelId=" + channelId + ", userId=" + userId + "]";
	}
}
